<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue"></script>
    <style>

    </style>
</head>

<body>
    <div id="app">
        <my-header></my-header>
        <my-header/>
    </div>
</body>

<template id="tmpl"> 
    <div>
        <h1>标题111</h1>
        <h2>标题222</h2>  
    </div>
</template>

<script>
    var vm = new Vue({
        el: '#app',
        data: {},
        components: {
            // myHeader: {
            //     template: '#tmpl'
            // }
            'my-header': { //换成 - 写法，但是要加双引号
                template: '#tmpl'
            }
        }
    })
</script>

</html>